Learning Objectives

After completing this lesson, you’ll be able to:

Controlling Geometry on Feature Types

Setting the appropriate geometry type is often necessary when writing data to a new format. For instance, you might read data from a PostGIS database table that (optionally) allows mixed geometries, but you need to write those features to an Esri geodatabase that restricts features to a single geometry type. What do you do in such a situation?

Geometry is part of the feature type schema, and you can view it in the reader and writer Feature Type parameters in the Geometry Definition table on the User Attributes tab:

Reader feature type geometry definitionWriter feature type geometry definition

Note

⭐ New for FME 2025.1: the geometry definition on feature types has moved to a new Spatial Definition table under the User Attributes tab.

Reader feature types (on the left) only display the Geometry Types from the source data and cannot be changed. Writer feature types (on the right) display the Geometry Type, and you can edit them to control what geometry type FME writes. If you don't set this parameter for formats that require it, the translation will fail. If the writer feature type receives invalid geometry, FME will drop the features and not write them. The Translation Log will issue a warning for each feature like this:

FileGDB Writer: Failed to write Geometry to feature class 'lines' with geometry type 'esriGeometryPolyline'. Dropping containing feature

The geometry type reported here is format-specific. You can learn more about these definitions and their correspondence to FME's geometry model by reading the reader/writer documentation for that format.

Filtering Geometry Using the GeometryFilter Transformer

The GeometryFilter transformer simplifies workflows by isolating features based on their geometry type. For example, you might filter a dataset of mixed geometries to separate points from polygons.

Steps to Use the GeometryFilter:

GeometryFilter example

Features with geometry that do not match any selected types will come from the <Unfiltered> port.

Note

The GeometryFilter has a Detailed mode that lets you filter any specific IFME geometry types from FME's data model.

Set Geometry using the GeometryCoercer

The GeometryCoercer transformer coerces features to a specific geometry type when possible. For example, you can coerce:

The GeometryCoercer is strict about changing a feature's geometry type. For example, you can't coerce points into point clouds. Unaffected features will appear from the Untouched port.

GeometryCoercer example

We'll cover other transformers that modify geometry in the next lesson.

Exercise: Set and Filter Geometry

Amar is continuing to learn about FME's geometry handling. He is reading a table from a PostGIS database called public.BusinessOwners. It contains information about local businesses' locations.

1) Open and Run Starting Workspace

Amar opens the starting workspace in FME Workbench (2026.1 or later).

This workspace requires access to a PostGIS database to work.

Note

If you are taking a Safe Software-hosted training course, this database connection should already exist and you can skip to step #2.

He expands FME Training PostGIS Database [POSTGIS] in the Navigator, double-clicks the Connection parameter, and chooses Add Database Connection.

Fixing database reference

He fills in the database connection details shown below:

Training database connection setup

He clicks Test and then Save. FME tests the connection and confirms that it is working.

2) Run Starting Workspace and Inspect Data

He runs the workspace to generate caches. He inspects the public.BusinessOwners cache and realizes that some of his points have null geometry and attributes:

Source data feature cache

Inspecting any feature with <null> attribute values shows that these features also do not have geometry, as it is missing from the Record Information Window:

Missing geometry

He'd like to filter out these null geometry features before writing to an Esri Geodatabase.

3) Add a GeometryFilter

To ensure he only writes valid points, Amar adds a GeometryFilter and connects it to the public.BusinessOwners reader feature type.

Connecting the GeometryFilter

He double-clicks the GeometryFilter and sets Output Ports to Null and Point:

Filtering Null and Point

He clicks OK to close the dialog.

He runs the workspace to view the results and notes the number of null and valid point features.

4) Add a Writer Feature Type and Set Geometry

Now that he has point features, Amar wants to write them out to the Esri Geodatabase. 

He uses Quick Add to add an Esri Geodatabase (OpenFile Geodb) writer configured like this:

Format Esri Geodatabase (OpenFile Geodb)
Dataset C:\FMEData\Output\Training\BusinessOwners.gdb
Parameters > Overwrite Existing Geodatabase Enabled
Feature Class or Table Definition Automatic...

Esri Geodatabase writer parameters

He clicks OK to add the writer. A Feature Type dialog appears, allowing him to configure the new feature type. He sets Feature Class or Table Name to BusinessOwners:

Geodatabase writer feature type Feature Class or Table Name

Then he clicks User Attributes and checks the Geometry Definition table. He sees it is set to define the geometry from the first feature:

Geometry from first feature setting in writer feature type

He clicks OK, and FME adds the writer feature type to the canvas.

5) Write Data

He connects the GeometryFilter's Point port to the BusinessOwners writer feature type and runs the workspace.

Writer feature type on the canvas

FME only writes valid point features, filtering out null geometries. He confirms by using Inspect Written Data on the BusinessOwners writer feature type, and confirms that only points are present:

View Written Data buttonPoints result

Map tiles © Stadia Maps, © OpenMapTiles, © OpenStreetMap contributors, © Stamen Design

Note

If these features had more information, like invalid geometry he could repair or attributes that he could use to identify and fix the data, he could keep working on the data from the Null port. However, neither is true, so the null geometry features won't proceed in the workspace and therefore won't be written out.

Challenge

Amar also has a set of address Point features in his workspace in the PostalAddress feature type. He'd like to create MultiPoints from them, grouping the points by Postalcode. What transformer can he use for that? How many MultiPoints does it result in?

Challenge question

Experiment to find out, taking note of your answers; you'll need them for the quiz.